<template>
  <div class="success-box">
    <TitleBar title="提交成功" :backFunction="goBack"></TitleBar>
    <div class="success-icon">
      <img src="../../assets/img/add-success.png" alt="">
    </div>
    <div class="success-content">
      <h6>已发送至您的邮箱！</h6>
      <div class="success-bg"></div>
      <div v-if="wxqr">
        <div class="qrcode">
          <img :src="wxqr" alt="二维码">
        </div>
        <p>长按识别二维码<br>添加微信客服</p>
      </div>
    </div>
    <SuccessFooter></SuccessFooter>
  </div>
</template>
<script>
import TitleBar from '../../components/TitleBar'
import SuccessFooter from '../../components/SuccessFooter'
import { mapState } from 'vuex'
export default {
  components: {
    TitleBar,
    SuccessFooter
  },
  data() {
    return {
    }
  },
  created() {
  },
  computed: {
    ...mapState({
      wxqr: s => s.serviceInfo.wxqr
    })
  },
  methods: {
    goBack() {
      this.$router.replace('/?catid=' + this.$route.query.catid)
    }
  }
}
</script>
<style lang='scss' scoped>
.success-box {
  background: #fff;
  height: 100vh;
  position: relative;
  .success-icon {
    margin: 0.4rem auto;
    text-align: center;
    img {
      width: 1.9rem;
      height: auto;
    }
  }
  .success-content {
    margin: 0 auto;
    width: 6.9rem;
    padding-bottom: 0.4rem;
    border: 1px solid rgba(153, 153, 153, 1);
    border-radius: 0.1rem;
    h6 {
      width: 3.4rem;
      height: 0.5rem;
      font-size: 0.3rem;
      font-weight: bold;
      color: rgba(51, 51, 51, 1);
      background: #fff;
      line-height: 0.5rem;
      text-align: center;
      margin: -0.25rem auto 0;
    }
    p {
      text-align: center;
      font-size: 0.28rem;
      line-height: 0.36rem;
      font-weight: 500;
      color: rgba(153, 153, 153, 1);
    }
    .success-bg {
      width: 5.87rem;
      height: 1.41rem;
      background: url(../../assets/img/success-bg.png) center no-repeat;
      background-size: cover;
      margin: 0.4rem auto 0.4rem;
    }
    .qrcode {
      text-align: center;
      img {
        width: 1.9rem;
        height: 1.9rem;
      }
    }
  }
  .footer {
    width: 100%;
    height: 1.6rem;
    background-color: #f8f7f5;
    padding: 0 0.66rem;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    p {
      font-size: 0.26rem;
      line-height: 0.76rem;
      // text-align: center;
      color: rgba(191, 191, 191, 1);
      img {
        width: 0.26rem;
        height: auto;
        vertical-align: middle;
      }
    }
    .call-box {
      display: flex;
      justify-content: space-between;
      span {
        font-size: 0.34rem;
        font-weight: bold;
        color: rgba(115, 158, 251, 1);
      }
      .qq-icon {
        display: inline-block;
        vertical-align: bottom;
        width: 0.36rem;
        height: 0.41rem;
        background: url(../../assets/img/success-icon.png) center no-repeat;
        background-size: cover;
        margin-right: 0.2rem;
      }
      img {
        margin-right: 0.14rem;
        width: 0.26rem;
        height: auto;
        vertical-align: bottom;
      }
    }
  }
}
</style>
